package com.lk.service.impl;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.lk.model.User;
import com.lk.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author : lk
 * @date 2021/11/10 11:38
 * @description : TODO
 * @since 1.0
 **/
@Service
@Slf4j
public class UserServiceImpl implements UserService {
    @Autowired
    private ObjectMapper objectMapper;
    @Override
    public String getData(String data) {

        try {
            User user = objectMapper.readValue(data, User.class);
            log.info("user:{}",user);
        } catch (JsonProcessingException e) {
            e.printStackTrace();
        }
        return "success";
    }
}
